
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="guide">
	<tr>
		<td>
			<span style="float: left;">后台管理中心&nbsp;&raquo;&nbsp;用户管理</span>
			<span style="float: right;">
				<a href="./?controller=user&action=add">+ 添加用户</a>
				<a href="javascript:history.go(-1);">&lt;- 返回</a>
			</span>
		</td>
	</tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
	<tr class="header">
		<td colspan="11">用户列表</td>
	</tr>
	<tr class="category" align="center">
		<td width="6%">ID</td>
		<td width="8%">用户名</td>
		<td width="10%">群组</td>
		<td width="10%">真实姓名</td>
		<td width="10%">登录时间</td>
		<td width="10%">登录IP</td>
		<td width="10%">上次登录时间</td>
		<td width="10%">上次登录IP</td>
		<td width="8%">登录次数</td>
		<td width="18%">操作</td>
	</tr>
<?php
$i = 0;

foreach ($this->data as $row)
{
	$id				= $row['id'];
	$username		= $row['username'];
	$groupid		= intval($row['groupid']);
	$groupRow		= $this->groupTable->getRow($groupid);
	$groupname		= $groupRow['name'];
	$realname		= $row['realname'];
	$logintime		= $row['logintime'];
	$logintime		= $logintime ? date('Y-m-d H:i:s', $logintime) : null;
	$loginip		= $row['loginip'];
	$loginip		= $loginip ? long2ip($loginip) : null;
	$prelogintime	= $row['prelogintime'];
	$prelogintime	= $prelogintime ? date('Y-m-d H:i:s', $prelogintime) : null;
	$preloginip		= $row['preloginip'];
	$preloginip		= $preloginip ? long2ip($preloginip) : null;
	$logintimes		= $row['logintimes'];
			
	echo <<<EOF
	<tr align="center">
		<td class="altbg1">$id</td>
		<td class="altbg2">$username</td>
		<td class="altbg1"><a href="./?controller=group&id=$groupid">$groupname</a></td>
		<td class="altbg2">$realname</td>
		<td class="altbg1">$logintime</td>
		<td class="altbg2">$loginip</td>
		<td class="altbg1">$prelogintime</td>
		<td class="altbg2">$preloginip</td>
		<td class="altbg1">$logintimes</td>
		<td class="altbg2" align="center">
			<a href="./?controller=user&action=modify&id=$id">修改资料</a>
			<a href="./?controller=user&action=modifyPassword&id=$id">修改密码</a>
			<a href="javascript:confirmDelete('./?controller=user&action=delete&id=$id')">删除</a>
		</td>
	</tr>
EOF;
}
?>
</table>
